﻿
namespace DataService.Dataset
{
	// ConnectionStringlerin tutulma yerine, Db authentication yontemine gore degisebilir. 
	// Varsayilan => config file da connection string elemanında bulunan EBakanlikDB key'i. 
	public class DataObjectFactory
	{
		private static string mDefaultConnectionString;

		static DataObjectFactory()
		{
			mDefaultConnectionString = DataServiceUtil.GetConnStr("ConnStrName");
		}

		public static IDataObject GetDataObject(string pDefaultDB, bool pIsTransactional)
		{
			IDataObject oDataObject = null;
			oDataObject = new DataObject(mDefaultConnectionString, pDefaultDB, pIsTransactional);
			return oDataObject;
		}

		public static IDataObject GetAnotherDataObject(string pConnectionStringName, string pDefaultDB, bool pIsTransactional)
		{
			string connectionString = DataServiceUtil.GetConnStr(pConnectionStringName);
			IDataObject oDataObject = null;
			oDataObject = new DataObject(connectionString, pDefaultDB, pIsTransactional);
			return oDataObject;
		}
	}
}
